package com.ophiux.member.api.factory;

import com.ophiux.member.api.fallback.MemberFeignAPIFallback;
import com.ophiux.member.api.feign.IMemberFeignApi;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MemberFeignAPIFallbackFactory implements FallbackFactory<IMemberFeignApi> {

    @Override
    public IMemberFeignApi create(Throwable throwable) {
        MemberFeignAPIFallback fallback = new MemberFeignAPIFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}